package com.hubing.cloud.app.web.es.query;

public class TermQueryBuilder extends AbstractQueryBuilder<TermQueryBuilder> {

	private final String fieldName;
	private final Object value;

	public TermQueryBuilder(String fieldName, String value) {
		this.fieldName = fieldName;
		this.value = value;
	}

	@Override
	public String toDocument() {
		return String.format("{" + " \"term\":{" + "   \"%s\":\"%s\"" + "  }" + "}", fieldName, value);
	}

	@Override
	public String toString() {
		return toDocument();
	}
}
